package com.cssw.fyzb.core.dao.acct;

import com.cssw.fyzb.core.model.dodb.*;
import com.ydn.dbframe.plugin.activerecord.Db;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * @Author: yangyiqun
 * @Date: 2020/7/10 17:33
 */
@Repository
public class TeamGzPriceDaoImpl implements TeamGzPriceDao {

    @Override
    public TeamGzPrice getByNum(Integer num) {
        StringBuffer sql = new StringBuffer();
        sql.append("select * from t_team_gz_price where min_num <= ? and max_num >= ? and state = '1'");
        return TeamGzPrice.dao.findFirst(sql.toString(), num, num);
    }

    @Override
    public List<TeamGzPrice> list() {
        StringBuffer sql = new StringBuffer();
        sql.append("select * from t_team_gz_price where state = '1' order by sort");
        return TeamGzPrice.dao.find(sql.toString());
    }
}
